const { Queue } = require("dynamic-queue");


let queue = new Queue();


let t1 = (next) => {
    setTimeout($ => {
        console.log("wait 3s");
        queue
        next();
    }, 3000);
};
//失败的
let t2 = new Promise(n => {
    return new Promise(r => {
        setTimeout($ => {
            console.log("wait 1s");
            r()
        }, 1000);
    })

})

queue.push(t1);
queue.push(t2);